// JavaScript Document

// fade
$("img").css("visibility", "hidden").imagesLoaded({
	progress: function(isBroken, $images, $proper, $broken) {
		var $this = $(this).css("visibility", "");
		if($.support.opacity) $this.css("opacity", 0).animate({"opacity": 1}, function() { $this.css({"opacity": ""}); if(!$this.attr("style")) $this.removeAttr("style"); });
	}
});

// inputs
$(" input, a.button, button").uniform();
//$("label").inFieldLabels();

// top menu
$("#top_menu > li").on({
	mouseenter: function() {
		if(!$("#doc:focus").length) $(this).children("div.dropdown").stop().hide().slideDown();
	},
	mouseleave: function() {
		if(!$("#doc:focus").length) $(this).children("div.dropdown").stop().attr("style", "");
	}
});

//nav
$("#nav").on({
	mouseenter:function() {
		$(this).children("ul.sub, div.detalle").stop(true).slideDown();
	},
	mouseleave:function() {
		$(this).children("ul.sub, div.detalle").hide().attr("style", "");
	}
}, "li");

//links
$("div.banner").on({
	click: function() {
		window.location = $(this).children("a").attr("href");
	},
	mouseenter: function() {
		$(this).hide().addClass("hover").stop(true).fadeIn("fast");
	},
	mouseleave: function() {
		$(this).hide().removeClass("hover").stop(true).fadeIn("fast");
	}
});

//tabs
var tabIndex=0;
$("ul.tabs, ol.tabs").tabs("div.pane", {tabs:"li:not(.disabled)", initialIndex:tabIndex});

// scrollable
$("div.scrollable").scrollable({circular: true}).autoscroll({interval: 6000, autopause: false});


$(".grid_11.suffix_2.alpha").mCustomScrollbar({
			scrollButtons:{enable:true},
			advanced:{updateOnContentResize:true},
			theme:"light-2"
});



//link externos
function abreventana(donde,quien,como)
{ 
infoventana=window.open(donde,quien,como);
if (navigator.appName.substring(0,8) == "Netscape")	
{
window.infoventana.focus()
}
}
function enlaza_vf(donde)
{
window.open(donde,'','toolbar=yes,status=yes,scrollbars=yes,resizable=yes,width=700,height=450,top=16,left=50');
}

function enlaza_vf1(donde)
{
window.open(donde,'','toolbar=no,status=no,scrollbars=no,resizable=no,width=410,height=253,top=16,left=50');
}

function enlaza(donde)
{
document.location=donde;
}
function enlaza_memoria(donde)
{
window.open(donde,'','toolbar=yes,status=yes,scrollbars=yes,resizable=yes,width=700,height=465,top=16,left=50');
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
function enlazapromo(donde)
{
window.open(donde,'','height=244,width=778,menubar=no,resizable=no,status=no,scrollbars=no,toolbar=no,location=no,hotkeys=0,top=16,left=16');
}
function ampliar(donde)
{
window.open(donde,'','height=252,width=318,menubar=no,resizable=no,status=no,scrollbars=no,toolbar=no,location=no,hotkeys=0,top=16,left=16');
}
function CambiaData(pagina)
{
	if (pagina!="0")
	{
	window.location.href=pagina;
	}
}